/*
 * 作者:熊猫
 * 日期:2017 - 3 - 14 11 - 21 - 50
 *
 */

package net.lainiao.morethread.Chapter6.demo3;

import java.util.Comparator;

/**
 * Created by Administrator on 2017/3/14.
 */
public class Event implements Comparable<Event> {
    private int threadId;
    private int priority;

    public Event(int threadId, int priority) {
        this.priority = priority;
        this.threadId = threadId;
    }

    @Override
    public int compareTo(Event o) {
        if(this.priority>o.getPriority()){
            return -1;
        }
        if(this.priority<o.getPriority()){
            return 1;
        }
        return 0;
    }

    public int getThreadId() {
        return threadId;
    }

    public int getPriority() {

        return priority;
    }
}
